﻿using GameFramework.Fsm;
using GameFramework.Procedure;
using Loxodon.Framework;
using UnityGameFramework.Runtime;

namespace StarForce
{
    public class ProcedureLogin: ProcedureBase
    {
        public override bool UseNativeDialog
        {
            get { return false; }
        }

        protected override void OnEnter(IFsm<IProcedureManager> procedureOwner)
        {
            base.OnEnter(procedureOwner);
            Log.Info("进入登录流程");
            var luaEnv = LuaEnvironment.LuaEnv;
            luaEnv.DoString(@"require(""GameMain""); GameMain.Start();");
            GameEntry.UI.OpenUIForm(100);
            // GameEntry.Sound.PlayMusic(1);
        }

        protected override void OnLeave(IFsm<IProcedureManager> procedureOwner, bool isShutdown)
        {
            base.OnLeave(procedureOwner, isShutdown);
        }
    }
}